<?php
App::import('Model', 'Comments.CmsComment');
class AssetComment extends CmsComment
{
	var $name = 'AssetComment';
	const PUBLISHED = 1;
	const UNPUBLISHED = 0;
	var $belongsTo = array(
					'ListingAsset'=>array(
							'className'=>'ListingAsset',
							'foreignKey'=>'listing_asset_id',
							'counterCache' => true,
							'counterScope' => array('AssetComment.status'=>self::PUBLISHED)
							),
					'User'=>array(
							'className'=>'Users.User',
							'foreignKey'=>'user_id',
							'counterCache' => true,
							'counterScope' => array('AssetComment.status'=>self::PUBLISHED)
							),								
					);
					
	var $actsAs = array(
			'Users.UserContent' => array(
				'badwordFilter' => true, 
				'fieldsToFilter' => array('body'),
				'posterModels'=>array('Users.User'=>array('dependent'=>true),'Users.Guest')	
				)					
					);
	function afterInitialize()
	{	
		parent::afterInitialize();	
		$this->setFieldProperties('body',array('class'=>'required'));
	}
}
?>